---------------------------------------------------------------
File name   :  vv_ahblite_bfm_h.e
Title       :  BFM unit declaration
Project     :  vv_ahblite eVC
Developers  :  stefan,filip
Created     :  27.07.2011.
Description :  This file declares the BFM unit.
Notes       :  
---------------------------------------------------------------
Copyright  (c)2011
---------------------------------------------------------------

<'

package vv_ahblite;

-- ====================================================================
-- This unit is the generic BFM. It is used as the base type for all
-- BFMs (master, and slave).
-- ====================================================================
extend vv_ahblite_bfm {
   
    env_name      : vv_ahblite_env_name_t;
    p_env         : vv_ahblite_env;
    !p_bus_monitor : vv_ahblite_bus_monitor;
    p_smp         : vv_ahblite_smp;
    p_sys_smp     : vv_ahblite_system_smp;
      
    -- This method init the bfm signals and variables values.
    init_values() is empty;  
    
    -- This method implements appropriate reset behavior
    reset_start() is {
        rerun();
    };
    
    -- This method implements appropriate after-reset behavior
    reset_end() is empty;
    
}; 

-- ====================================================================
-- The master BFM extends the generic BFM
-- ====================================================================
extend vv_ahblite_master_bfm {
  
    p_master      : vv_ahblite_master;
    !p_driver      : vv_ahblite_master_driver_u;
    !transaction : MASTER vv_ahblite_transaction;
    
    
    -- This TCM continuously gets transactions from the driver and passes
    -- them to the BFM.
    main_loop() @p_sys_smp.clk is empty;
    
    -- This TCM gets a transaction and drive it into the DUT
    drive_transaction (cur_transaction :  vv_ahblite_transaction)
      @p_sys_smp.clk is empty;
    
    -- This TCM drives the address of the transaction 
    drive_transaction_address (cur_transaction :  vv_ahblite_transaction)
      @p_sys_smp.clk is empty;
      
    drive_control_signals (cur_transaction :  vv_ahblite_transaction)
      @p_sys_smp.clk is empty; --drives HBURST,HSIZE,HTRANS....
    
    -- This TCM drives the data of the transaction 
    drive_transaction_data (cur_transaction :  vv_ahblite_transaction)
      @p_sys_smp.clk is empty;-- @@this method is being called only if write operatoin is active. it drives HWDATA[31:0]
  
};

-- ====================================================================
-- The slave BFM extends the generic BFM
-- ====================================================================
extend vv_ahblite_slave_bfm {

    p_slave       : vv_ahblite_slave; 
    !p_driver      : vv_ahblite_slave_driver_u;
    !transaction_resp: SLAVE vv_ahblite_transaction;
    
    !last_transaction: SLAVE vv_ahblite_transaction;
    
    main_loop()  @p_sys_smp.clk is empty;
    
    -- This TCM drive response to a transaction from the DUT
    drive_transaction (response : SLAVE vv_ahblite_transaction)
      @p_sys_smp.clk is empty;
    
    drive_transaction_control (cur_transaction : SLAVE vv_ahblite_transaction)
      @p_sys_smp.clk is empty; --drives HRESP and HREADY
    
    -- This TCM drives the data of the transaction response
    drive_transaction_data (response : SLAVE vv_ahblite_transaction)
      @p_sys_smp.clk is empty;
    
    -- This method creates a default transaction response
    create_default_transaction() : SLAVE vv_ahblite_transaction is empty;

};

'>

